#ifndef __GRAPHICSLAYER_H__
#define __GRAPHICSLAYER_H__

#define MIN_WATER_TILE 300
#define MAX_WATER_TILE 333

#pragma comment(lib,"dxguid.lib")
#pragma comment(lib,"d3d9.lib")
#pragma comment(lib,"d3dx9.lib")
#pragma comment(lib,"dxerr8.lib")
#pragma comment(lib,"winmm.lib")

#include <D3D9.h>
#include <D3DX9.h>
#include "cScene.h"
#include "cMouse.h"
#include "cPC.h"
#include "cNPC.h"
#include "cDialogBox.h"
#include <vector>

using namespace std;

class cGraphicsLayer  
{
	private:
		LPDIRECT3D9 g_pD3D;
		LPDIRECT3DDEVICE9 g_pD3DDevice;
		LPD3DXSPRITE g_pSprite;

		LPDIRECT3DTEXTURE9 texMain, texGame, texFont, texNPCs;
		LPDIRECT3DTEXTURE9 texTiles, texTilesWar, texCharacters, texMouse;
		LPDIRECT3DTEXTURE9 texPuebloTopLayer;
		bool showingHeight;

	public:
		cGraphicsLayer(void);
		~cGraphicsLayer(void);

		bool Init(HWND hWnd, bool exclusive); 
		void Finalize(void);
	
		void LoadData(void);
		void UnLoadData(void);
		bool Render(int state, cMouse *mouse, cScene *scene, cPC *player, vector<cNPC*> *v_NPCs,cDialogBox *dialog);

		
		bool DrawScene(cScene *scene, bool editor);
		void DrawDialog(cDialogBox *dialog);
		bool DrawTopLayer(cScene *Scene,bool editor);
		bool DrawAvailableTiles(cScene *scene);
		bool DrawRadar(cScene *scene, cPC *player, vector<cNPC*> *v_NPCs);
		bool DrawUnits(cScene *scene, cPC *player, vector<cNPC*> *v_NPCs);
		bool DrawMouse(cMouse *mouse);

		// Editor mode:
		bool IsShowingHeight(void);
		void SetShowingHeight(bool showingHeight);
};

#endif